package com.wf.course.service.impl;

import com.utils.page.PageBean;
import com.wf.course.dao.IActivityImgMapper;
import com.wf.course.model.comm.ActivityImg;
import com.wf.course.service.IActivityImgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by chenli on 2017/3/22.
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class IActivityImgServiceImpl implements IActivityImgService {

    @Autowired
    private IActivityImgMapper mapper;

    @Override
    public void getImgsList(PageBean<ActivityImg> pageBean) {
        pageBean.setResults(this.mapper.getActivityImgList(pageBean));
        pageBean.setTotalCount(this.mapper.getActivityImgCount(pageBean));
    }

    @Override
    public void saveImg(ActivityImg img) {
        this.mapper.saveImg(img);
    }

    @Override
    public void deleteImg(Integer id) {
        this.mapper.deleteImg(id);
    }

    @Override
    public ActivityImg downLoadImg(Integer id) {
        return this.mapper.downLoadImg(id);
    }

    @Override
    public Integer updateImg(ActivityImg img) {
        return this.mapper.updateImg(img);
    }
}
